﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Bas1a41
    {
		private string _plistid;
		private string _taxid;
		private double _taxpct;
		private string _taxapp;
		private string _listid;
		
        /// <summary>
        /// 合同主键
        /// </summary>
		public string Plistid
		{
			get { return _plistid;	 }
			set { _plistid=value;	}
		}
        /// <summary>
        /// 费用代码
        /// </summary>
		public string Taxid
		{
			get { return _taxid;	 }
			set { _taxid=value;	}
		}
        /// <summary>
        /// 费率
        /// </summary>
		public double Taxpct
		{
			get { return _taxpct;	 }
			set { _taxpct=value;	}
		}
        /// <summary>
        /// 费用发生时点
        /// </summary>
		public string Taxapp
		{
			get { return _taxapp;	 }
			set { _taxapp=value;	}
		}
        /// <summary>
        /// 主键
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
		
		public static List<Bas1a41> GetBas1a41ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Bas1a41> list = new List<Bas1a41>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Bas1a41 model = GetBas1a41ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Bas1a41 GetBas1a41ByDataRow(DataRow dr)
		{
			Bas1a41 model = new Bas1a41(); //实例化Bas1a41
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("plistid")&&!(dr["plistid"] is System.DBNull))  
				model.Plistid = ( string)dr["plistid"];
			if (dcc.Contains("taxid")&&!(dr["taxid"] is System.DBNull))  
				model.Taxid = ( string)dr["taxid"];
			if (dcc.Contains("taxpct")&&!(dr["taxpct"] is System.DBNull))  
				model.Taxpct = Convert.ToDouble(dr["taxpct"]);
			if (dcc.Contains("taxapp")&&!(dr["taxapp"] is System.DBNull))  
				model.Taxapp = ( string)dr["taxapp"];
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			
			return model;
		}
    }
}
